package com.gxuwz.com_property.login.service.Impl;

import com.gxuwz.com_property.login.mapper.LoginMapper;
import com.gxuwz.com_property.login.pojo.LoginUser;
import com.gxuwz.com_property.login.service.LoginService;
import com.gxuwz.com_property.utils.MD5EncryptUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class LoginServiceImpl implements LoginService {

    @Autowired
    private LoginMapper loginMapper;

    @Override
    public LoginUser loginUser(LoginUser loginUser) {
        try {
            LoginUser loginUser1 = loginMapper.loginUser(loginUser);
            if (loginUser1!=null){
                return loginUser1;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public LoginUser findloginUserByUserName(String account) {
        try {
            LoginUser loginUser = loginMapper.findloginUserByUserName(account);
            return loginUser;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}
